package com.streamhub.client;

/**
 * The failover algorithm to use when choosing a server to 
 * failover to.
 * 
 * @see	{@link FailoverParameters}
 */
public enum FailoverAlgorithm {
	/**
	 * The servers will be tried in order from top to bottom.
	 */
	ORDERED("ordered"),
	
	/**
	 * The first server in the failover list will always be tried upon each connection lost.  This algorithm favours servers higher up the list.
	 */
	PRIORITY("priority"),
	
	/**
	 * A failover server wil be chosen at random.
	 */
	RANDOM("random");

	private final String configName;

	private FailoverAlgorithm(String configName) {
		this.configName = configName;
	}
	
	@Override
	public String toString() {
		return this.configName;
	}
}
